package io.huaguoguo.spring.controller;

import io.huaguoguo.spring.publish.ChatPublish;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 描述：  <br>
 * CreateDate: 2021/5/28 <br>
 *
 * @author huaguoguo
 */
@RestController
public class ChatController {

    @Autowired
    ChatPublish chatPublish;

    @GetMapping("/pub/{message}")
    public String publish(@PathVariable("message") String message, HttpServletRequest request) {
        request.getMethod();
        chatPublish.publish(message);
        return "发送成功";
    }
}
